home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / library / locator.lha / locator / example / Locator_Example.e < prev    next >
Text File  |  1996-01-10  |  1KB  |  60 lines

  1. /*
  2. ** This is a LOCATOR LIBRARY EXAMPLE
  3. **
  4. ** Please, copy file Locator/Example/Locator.catalog TO Ram:
  5. **
  6. ** IF the file is missgin, message will be in Italian! ;)
  7. **
  8. ** This code is (C)Copyright 1996 Fabio Rotondo AND it is
  9. ** placed in the Public Domain.
  10. **
  11. */
  12.  
  13. MODULE 'locator'
  14.  
  15. /* These conts were generated by LocConv ;) */
  16.  
  17. CONST MSG_ABOUT = 0
  18. CONST MSG_MOMMY = 1
  19. CONST MSG_HIEVERYBODY = 2
  20. CONST MSG_COPYRIGHT = 3
  21.  
  22.  
  23. PROC main()
  24.   DEF h:PTR TO LONG
  25.  
  26.   IF (locatorbase:=OpenLibrary('locator.library',0))
  27.     IF Loc_Init()
  28.       IF (h:=Loc_AllocHandler())
  29.         IF Loc_Open(h,'Ram:Locator.catalog')
  30.           error('"Ram:Locator.catalog"')
  31.           WriteF('Messages will be in Italian!\n')
  32.         ENDIF
  33.  
  34.         WriteF('About Msg: \s\n', Loc_Message(h, MSG_ABOUT, 'Locator Library è scritta da Fabio Rotondo.'))
  35.         WriteF('MOMMY Msg: \s\n', Loc_Message(h, MSG_MOMMY, 'Ciao Mamma!'))
  36.         WriteF('Hi Everybody Msg:\s\n', Loc_Message(h, MSG_HIEVERYBODY, 'Ciao a Tutti!') )
  37.         WriteF('Copyright Msg:\s\n', Loc_Message(h, MSG_COPYRIGHT, 'Copyright di Fabio Rotondo'))
  38.  
  39.         Loc_Close(h)
  40.         Loc_FreeHandler(h)
  41.       ELSE
  42.         error('Handler')
  43.       ENDIF
  44.       Loc_Dispose()
  45.     ELSE
  46.       error('Loc_Init()')
  47.     ENDIF
  48.     CloseLibrary(locatorbase)
  49.   ELSE
  50.     error('locator.library')
  51.   ENDIF
  52.   CleanUp(0)
  53. ENDPROC
  54.  
  55. PROC error(s)
  56.     WriteF('*** Error: could not open \s!!\n\n', s)
  57. ENDPROC
  58.  
  59.  
  60.